<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var num = 1;
        function fn1() {
            function fn2() {
                function fn3() {
                    // var num = 4; //4
                     console.log(num) 
                    //  var num = 4; //undefiend
                }
                var num = 6;
                fn3();
            }
            fn2();
        }
        var num = 5;
        fn1();
        // console.log(num)
            


    </script>
</body>
</html>